﻿@model IEnumerable<ClientManager.Web.Models.ClientViewModel>

@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<div class="page-header">
    <h1>Clients</h1>
</div>

<div class="row">
    <div class="col-md-12">
        <a class="btn btn-primary" href="@Url.Content("~/Client/Create/")"><span class="glyphicon glyphicon-plus" style="margin-right:4px;"></span>Create new</a>
    </div>
</div>

<div class="row" style="margin-top: 10px">
    <div class="col-md-12">

        <table class="table table-striped">
            <tr>
                
                <th>
                    @Html.DisplayNameFor(model => model.FirstName)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.Surname)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.ServiceLevelName)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.DateCreated)
                </th>
                <th></th>
            </tr>

            @foreach (var item in Model)
            {
                <tr>
                   
                    <td>
                        @Html.DisplayFor(modelItem => item.FirstName)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.Surname)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.ServiceLevelName)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.DateCreated)
                    </td>
                    <td>

                        <a href="@Url.Content("~/Client/Edit/"+item.ClientId)" title="Edit"><span class="glyphicon glyphicon-edit"></span></a>
                        <a href="@Url.Content("~/Client/Details/" + item.ClientId)" style="margin-left: 2px" title="Detail"><span class="glyphicon glyphicon-search"></span></a>
                        <a href="@Url.Content("~/Client/Delete/" + item.ClientId)" style="margin-left: 2px" title="Delete"><span class="glyphicon glyphicon-trash"></span></a>

                    </td>
                </tr>
            }

        </table>
    </div>
</div>